
package rpg;
import javax.microedition.lcdui.*;
class GraphicsEffects
{
	private static GraphicsEffects instance;
	private GraphicsEffects()
	{ 
	}
	static GraphicsEffects getInstance()
    {
        if (instance == null)
        {
            instance = new GraphicsEffects();
        }
        return instance;
    }

	public void drawClipImage(Graphics g,Image a,int clipX,int clipY,int clipW,int clipH,int offx,int offy)
	{
		int x,y,cw,ch;
		x=g.getClipX();
		y=g.getClipY();
		cw=g.getClipWidth();
		ch=g.getClipHeight();
		g.setClip(clipX,clipY,clipW,clipH);
		g.drawImage(a,clipX-offx,clipY-offy,0);
		g.setClip(x,y,cw,ch);
	}	

	public void drawStringShadow(Graphics g, int mainColor, int topColor, int bottomColor, String str, int x, int y, int anchor)
	{  
      g.setFont(MenuCanvas.mFont);                 
    	g.setColor(topColor);   
    	g.drawString(str,x-1,y,anchor);   
    	g.drawString(str,x,y-1,anchor);   
    	g.drawString(str,x-1,y-1,anchor);
      g.setColor(bottomColor); 
      g.drawString(str,x+1,y,anchor); 
      g.drawString(str,x,y+1,anchor);
      g.drawString(str,x+1,y+1,anchor);
      g.setColor(mainColor);
      g.drawString(str,x,y,anchor); 
  }	
}